package com.rundatop;

import javax.servlet.MultipartConfigElement;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
@MapperScan("com.rundatop.dao.mapper")
public class KaiSaWxApplication {

	public static void main(String[] args) {
		SpringApplication.run(KaiSaWxApplication.class, args);
	}
	
	  /**
     * 文件上传配置
     * 
     * @return
     */
    @SuppressWarnings("deprecation")
    @Bean
    public MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();
        // 文件最大
        factory.setMaxFileSize("500MB"); // KB,MB
        /// 设置总上传数据总大小
        factory.setMaxRequestSize("500MB");
        return factory.createMultipartConfig();
    }

}
